import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { CPComponent } from './cp';
import { GuideMgmtComponent } from './guideMgmt';
import { CPDelComponent } from './cp/cpDel';
import { UsersComponent } from './users';
import { GuideAddComponent } from './guideMgmt/guideAdd';
import { TravelAgencyAddComponent } from './travelAgency/travelAgencyAdd';
import { TravelAgencyComponent } from './travelAgency';
import { OrdersComponent } from './order';
import { TransactionsComponent } from './transactions';
import { GuideDetailComponent } from './guideMgmt/guideDetail';
import { TravelAgencyDetailComponent } from './travelAgency/travelAgencyDetail';
import { RechargeComponent } from './recharge';
import { AddRechargeComponent } from './recharge/add';
import { UserAddComponent } from './users/userAdd';
import { UserLogComponent } from './users/userLog';
import { ClassifyMgmtComponent } from './classify/classify';
import { ClassifyAddComponent } from './classify/classifyAdd';

const routes: Routes = [
	{
		path: '',
		children: [
			{
				path: '',
				redirectTo: 'cp',
			},
			{
				path: 'cp',
				component: CPComponent,
				data: {
					title: '产品',
					url: 'basicSetting/cp',
				},
			},
			{
				path: 'CPDel',
				component: CPDelComponent,
				data: {
					title: '产品详情',
					url: 'basicSetting/CPDel',
				},
			},
			{
				path: 'guideMgmt',
				component: GuideMgmtComponent,
				data: {
					title: '服务管理',
					url: 'basicSetting/guideMgmt',
				},
			},
			{
				path: 'guideAdd',
				component: GuideAddComponent,
				data: {
					title: '服务管理',
					url: 'basicSetting/guideAdd',
				},
			},
			{
				path: 'guideDetail',
				component: GuideDetailComponent,
				data: {
					title: '服务管理',
					url: 'basicSetting/guideDetail',
				},
			},
			{
				path: 'users',
				component: UsersComponent,
				data: {
					title: '用戶管理',
					url: 'basicSetting/users',
				},
			},
			{
				path: 'userAdd',
				component: UserAddComponent,
				data: {
					title: '用戶管理',
					url: 'basicSetting/userAdd',
				},
			},
			{
				path: 'userLog',
				component: UserLogComponent,
				data: {
					title: '用戶管理',
					url: 'basicSetting/userLog',
				},
			},
			{
				path: 'travelAgency',
				component: TravelAgencyComponent,
				data: {
					title: '机构管理',
					url: 'basicSetting/travelAgency',
				},
			},
			{
				path: 'travelAgencyAdd',
				component: TravelAgencyAddComponent,
				data: {
					title: '机构管理',
					url: 'basicSetting/travelAgencyAdd',
				},
			},
			{
				path: 'travelAgencyDetail',
				component: TravelAgencyDetailComponent,
				data: {
					title: '机构管理',
					url: 'basicSetting/travelAgencyDetail',
				},
			},
			{
				path: 'orders',
				component: OrdersComponent,
				data: {
					title: '订单管理',
					url: 'basicSetting/orders',
				},
			},
			{
				path: 'transactions',
				component: TransactionsComponent,
				data: {
					title: '交易管理',
					url: 'basicSetting/transactions',
				},
			},
			{
				path: 'recharge',
				component: RechargeComponent,
				data: {
					title: '充值管理',
					url: 'basicSetting/recharge',
				},
			},
			{
				path: 'rechargeAdd',
				component: AddRechargeComponent,
				data: {
					title: '账户充值',
					url: 'basicSetting/recharge/add',
				},
			},
			{
				path: 'classify',
				component: ClassifyMgmtComponent,
				data: {
					title: '分类配置',
					url: 'basicSetting/classify',
				},
			},
			{
				path: 'classifyAdd',
				component: ClassifyAddComponent,
				data: {
					title: '分类配置',
					url: 'basicSetting/classifyAdd',
				},
			},
			{
				path: '**',
				redirectTo: 'home',
			},
		],
	},
];

@NgModule({
	imports: [RouterModule.forChild(routes)],
	exports: [RouterModule],
})
export class BasicSettingRoutingModule { }
